import request from '@/utils/request'
import { type Menu } from './power/menu'

export interface UserInfo {
  username: string
  token: string
  roles: number[]
  permissions: string[]
  menus: Menu[]
}

// 获取用户信息
export const getInfo = () => request.get<UserInfo>('/getInfo')
// 登录
export const loginUser = (data: any) => request.post<{ token: string }>('/login', data)
// 退出登录
export const logoutUser = () => request.post('/logout')
